package com.itboye.zhujia.me;

import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.itboye.zhujia.R;
import com.itboye.zhujia.base.BaseActivity;
import com.itboye.zhujia.constants.SPContants;
import com.itboye.zhujia.custom.RoundImageView;
import com.itboye.zhujia.util.SPUtils;
import com.itboye.zhujia.util.XImageLoader;

/**
 * 个人中心
 * 
 */
public class ActivityPersonalCenter extends BaseActivity implements
		OnClickListener {
	ImageView close_icon;//返回图片
	TextView add_shap_title_tv;//标题
	RelativeLayout personal_data;// 个人信息
	RelativeLayout personal_con;// 认证信息
	RelativeLayout personal_account;// 我的账户
	RelativeLayout personal_kefu;// 联系客服

	TextView person_name;//昵称
	
	RoundImageView person_head;//头像
	
	Button person_type;//切换模式按钮
	
	@Override
	public int initView() {
		return 0;
	}

	@Override
	public void onMyCreate() {
		setContentView(R.layout.activity_personal_center);
		add_shap_title_tv.setText("个人中心");
		
		
		
		
	}
	@Override
	protected void onStart() {
		super.onStart();
		read();
	}
	/**
	 * 读取数据
	 */
	private void read(){
		person_name.setText("用户名:"+(String) SPUtils.get(ActivityPersonalCenter.this, null, SPContants.NICK,
				""));
		
		String uri = (String) SPUtils.get(ActivityPersonalCenter.this, null, SPContants.AVATAR_URL,
				"");
		XImageLoader.load(uri, person_head);
	}

	@Override
	public void onClick(View v) {
		Intent intent = null;
		switch (v.getId()) {
		case R.id.close_icon:// 返回
			finish();

			break;
		case R.id.person_type:// 切换模式

			break;
		case R.id.personal_data:// 个人信息
			intent = new Intent(ActivityPersonalCenter.this, ActivityMyData.class);
			startActivity(intent);
			break;
		case R.id.personal_con:// 认证信息

			break;
		case R.id.personal_account:// 我的账户

			break;
		case R.id.personal_kefu:// 联系客服

			break;

		default:
			break;
		}

	}

}
